/*
 *  Copyright 2009 Utkin Dmitry
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
 
/* 
 *  This file is part of the WSF Staff project.
 *  Please, visit http://code.google.com/p/staff for more information.
 */

// This file generated by staff_codegen
// DO NOT EDIT

#include <rise/plugin/PluginExport.h>
#include <rise/common/MutablePtr.h>
#foreach $(Project.Interfaces)
#include "$(Interface.Name)Wrapper.h"
#end
#include "ComponentImpl.h"

RISE_DECLARE_PLUGIN($(Project.Interfaces.Interface.Classes.Class.Namespace)CComponentImpl)

$(Project.Interfaces.Interface.Classes.Class.OpeningNs)
  CComponentImpl::CComponentImpl()
  {
#foreach $(Project.Interfaces)
#foreach $(Interface.Classes)
    m_mServices["$(Class.ServiceNsName)"] = new $(Class.NsName)Wrapper(this);
#end
#end
  }

  CComponentImpl::~CComponentImpl()
  {
  }

  const rise::CString& CComponentImpl::GetName() const
  {
    return m_sName;
  }

  const staff::CService* CComponentImpl::GetService( const rise::CString& sService ) const
  {
    staff::TServiceMap::const_iterator itService = m_mServices.find(sService);
    if (itService == m_mServices.end())
      return NULL;

    return itService->second;
  }

  staff::CService* CComponentImpl::GetService( const rise::CString& sService )
  {
    staff::TServiceMap::iterator itService = m_mServices.find(sService);
    if (itService == m_mServices.end())
      return NULL;

    return itService->second;
  }

  const staff::TServiceMap& CComponentImpl::GetServices() const
  {
    return m_mServices;
  }

  const rise::CString CComponentImpl::m_sName = "$(Project.Interfaces.Interface.Classes.Class.ComponentName)";

$(Project.Interfaces.Interface.Classes.Class.EndingNs)
